package com.toolmanrln.common.api;

import com.toolmanrln.common.base.IEnum;

/**
 * @author ToolMan.RLN
 * @since 2020-05-18 10:32
 */
public enum ResultCodeEnum implements IEnum {

    SUCCESS(200, "操作成功"),
    FAILED(500, "操作失败"),
    UNAUTHORIZED(401, "认证失败，请重新登录"),
    TOKEN_EXPIRED(401, "token已经过期，请重新登录"),
    ERROR_TOKEN(401, "token不正确，请重新登录"),
    FORBIDDEN(403, "没有相关权限");

    private Integer code;
    private String message;

    ResultCodeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public Integer getKey() {
        return this.code;
    }

    @Override
    public String getValue() {
        return this.message;
    }
}
